#include <iostream>

using namespace std;

class Solution 
{
public:
    bool search(int A[], int n, int target)
	{
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
		for(int i=0;i<n;i++)
		{
			if(A[i] == target)
				return true;
		}

		return false;        
    }
};


int main()
{
	int n,k;
	Solution s;
	while(cin>>n)
	{
		if(n<=0)
			break;
		cin>>k;
		int* A = new int[n];
		for(int i=0;i<n;i++)
			cin>>A[i];

		int idx = s.search(A,n,k);
		cout<<idx<<endl;		
	}
}